// 首页路径
const HOME_PATH = '/pages/load/load'

// isTabPage 是否Tab页面 默认 false
// isHardDepCid 依赖cardId 默认 true
const PATH_MAP = {
  // 企业版
  'pages/tabbar/card/card': { isTabPage: true, tabIndex: 0, isCardPage: true },
  'pages/tabbar/mall/mall': { isTabPage: true, tabIndex: 1 },
  'pages/tabbar/dynamic/dynamic': { isTabPage: true, tabIndex: 2 },
  'pages/tabbar/website/website': { isTabPage: true, tabIndex: 3 },
  'pages/tabbar/usercenter/usercenter': { isTabPage: true, tabIndex: 4 },
  'pages/load/load': { isHardDepCid: false },
  'pages/tabbar/home/home': { isHardDepCid: false }
}

function isTabPage(route) {
  return PATH_MAP[route] ? PATH_MAP[route].isTabPage : false
}

function isCardPage(route) {
  return PATH_MAP[route] ? PATH_MAP[route].isCardPage : false
}

// 检查落地页是否依赖cardId
function isDependCard(route) {
  const config = PATH_MAP[route]
  return !(config && config.isHardDepCid === false)
}

export default PATH_MAP

export { HOME_PATH, isTabPage, isCardPage, isDependCard }
